<template>
	<view class="divination-card" :class="type" @tap="handleTap">
		<view class="icon">
			<text class="icon-text">{{ icon }}</text>
		</view>
		<text class="title">{{ title }}</text>
	</view>
</template>

<script>
export default {
	name: 'DivinationCard',
	props: {
		icon: {
			type: String,
			required: true
		},
		title: {
			type: String,
			required: true
		},
		type: {
			type: String,
			required: true,
			validator: function (value) {
				return ['time', 'number'].indexOf(value) !== -1
			}
		}
	},
	methods: {
		handleTap() {
			this.$emit('tap');
		}
	}
}
</script>

<style lang="scss" scoped>
.divination-card {
	background-color: rgba(255, 255, 255, 0.9);
	border-radius: 32rpx;
	padding: 32rpx;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 280rpx;
	box-shadow: 0 8rpx 32rpx rgba(106, 130, 251, 0.15);
	transition: transform 0.2s ease;
	
	&:active {
		transform: scale(0.98);
	}
	
	.icon {
		width: 120rpx;
		height: 120rpx;
		border-radius: 60rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-bottom: 16rpx;
		
		.icon-text {
			font-size: 96rpx;
			line-height: 1;
		}
	}
	
	.title {
		font-size: 32rpx;
		font-weight: 500;
		color: #000000;
	}
	
	&.time .icon {
		background: linear-gradient(135deg, #E0FFE6 0%, #C2FFD0 100%);
	}
	
	&.number .icon {
		background: linear-gradient(135deg, #FFFAE0 0%, #FFF7C2 100%);
	}
}
</style>